www.gusucode.com > 基于Matlab的MIMO通信系统仿真 含报告;司中威;了解移动通信 > 基于Matlab的MIMO通信系统仿真 含报告;司中威;了解移动通信关键技术,了解数字通信系统仿真流程,实现基本的信道编译码、调制解调等通信模块。(好评如潮,课设拿满) 学习并实现MIMO空时处理技术 学习性能分析的思路和方法/mimo/matlab for mimo 2x2/read_int16_hex.m

    function A=read_int16_hex(name)
%
% A = read_int16_hex(filename)
%
% Read the 16-bit signed integer values
% stored in a Code Composer Studio .dat file.
% 
% Return value: A = vector containing elements from .dat file

fid = fopen(name,'rt');
x = fscanf(fid,'%d',2);
if x(1) ~= 1651 | x(2) ~= 1
    error('Not a valid hex-format .dat file!')
end

x = fscanf(fid,'%s',3);
x = fscanf(fid,'%c',1);
x = fscanf(fid,'%c');
x = reshape(x,[11 length(x)/11]);
x = x(3:end-1,:);
x = reshape(x,[4 length(x(:))/4]).';
A = hex2dec(x).';

% convert to signed
A = A - (A>2^15-1)*2^16;

% Correct endianess
A = [A(2:2:end); A(1:2:end)];
A = A(:);